//定义了Matchvs网络事件
export enum MVS_MSG {
    INIT = "_INIT", // response.initResponse(status:number);状态返回，200表示成功，其他失败
    REGISTER_USER = "_REGISTER_USER", // response.registerUserResponse(userInfo:MsRegistRsp);
    LOGIN = "_LOGIN", // response.loginResponse(login:MsLoginRsp);
    LOGOUT = "_LOGOUT",  // response.logoutResponse(status:number);
    RE_CONNECT = "_RE_CONNECT", // response.reconnectResponse(status:number, roomUserInfoList:Array<MsRoomUserInfo>, roomInfo:MsRoomInfo);
    ERROR_MSG = "_ERROR_MSG",   // response.errorResponse(errCode:number, errMsg:string)
    JOIN_ROOM_RSP = "_JOIN_ROOM_RSP",  // response.joinRoomResponse(status:number, roomUserInfoList:Array<MsRoomUserInfo>, roomInfo:MsRoomInfo);
    JOIN_ROOM_NOTIFY = "_JOIN_ROOM_NOTIFY", // response.joinRoomNotify(roomUserInfo:MsRoomUserInfo);
    LEAVE_ROOM = "_LEAVE_ROOM", // response.leaveRoomResponse(rsp:MsLeaveRoomRsp);
    LEAVE_ROOM_NOTIFY = "_LEAVE_ROOM_NOTIFY", // response.leaveRoomNotify(leaveRoomInfo:MsLeaveRoomNotify);
    JOIN_OVER_RSP = "_JOIN_OVER_RSP", // response.joinOverResponse(rsp:MsJoinOverRsp);
    JOIN_OVER_NOTIFY = "_JOIN_OVER_NOTIFY", // response.joinOverNotify(notifyInfo:MsJoinOverNotifyInfo);
    JOIN_OPEN_RSP = "_JOIN_OPEN_RSP",      // joinOpenResponse(data:MsReopenRoomResponse);
    JOIN_OPEN_NOTIFY = "_JOIN_OPEN_NOTIFY",//joinOpenNotify(data:MsReopenRoomNotify);
    ROOM_LIST_EX = "_ROOM_LIST_EX", // response.getRoomListExResponse(rsp:MsGetRoomListExRsp);
    CREATE_ROOM = "_CREATE_ROOM", // response.createRoomResponse(rsp:MsCreateRoomRsp);
    ROOM_DETAIL = "_ROOM_DETAIL", // response.getRoomDetailResponse(rsp:MsGetRoomDetailRsp);
    KICK_PLAYER = "_KICK_PLAYER",   // response.kickPlayerResponse(rsp:MsKickPlayerRsp);
    KICK_PLAYER_NOTIFY = "_KICK_PLAYER_NOTIFY", // response.kickPlayerNotify(knotify:MsKickPlayerNotify)
    SET_ROOM_PROPERTY = "_SET_ROOM_PROPETY", //response.setRoomPropertyResponse(rsp:MsSetRoomPropertyRspInfo);
    SET_ROOM_PROPERTY_NOTIFY = "_SET_ROOM_PROPETY_NOTIFY", // response.setRoomPropertyNotify(notify:MsRoomPropertyNotifyInfo);
    SEND_EVENT_RSP = "_SEND_EVENT_RSP", // response.sendEventResponse(rsp:MsSendEventRsp);
    SEND_EVENT_NOTIFY = "_SEND_EVENT_NOTIFY", // response.sendEventNotify(eventInfo:MsSendEventNotify);
    FRAME_UPDATE = "_FRAME_UPDATE", // response.frameUpdate(data:MsFrameData);
    NETWORK_STATE_NOTIFY = "_NETWORK_STATE_NOTIFY", // response.networkStateNotify(netnotify:MsNetworkStateNotify);

    SERVER_NOTIFY = "_SERVER_NOTIFY", // response.gameServerNotify(eventInfo:MsGameServerNotifyInfo);
    EVENT_GROUP_SUB = "_EVENT_GROUP_SUB", // response.subscribeEventGroupResponse(status:number, groups:Array<string>);
    SEND_FRAME_EVENT = "_SEND_FRAME_EVENT", // response.sendFrameEventResponse(rsp:MsSendFrameEventRsp);
    SET_FRAME_SYNC = "_SET_FRAME_SYNC", // response.setFrameSyncResponse(rsp:MsSetChannelFrameSyncRsp);
    SET_FRAME_SYNC_NOTIFY = "_SET_FRAME_SYNC_NOTIFY", // response.setFrameSyncNotify(rsp:MVS.MsSetFrameSyncNotify);
    GET_OFFLINE_DATA = "_OFFLINE_DATA", // response.getOffLineDataResponse(rsp)
    SEND_EVENT_GROUP = "_SEND_EVENT_GROUP", // response.sendEventGroupResponse(status:number);
    SEND_EVENT_GROUP_NOTIFY = "_SEND_GROUP_NOTIFY", // response.sendEventGroupNotify(srcUid:number, groups:Array<string>, cpProto:string);

    WATCH_ROOM_LIST = "_WATCH_ROOM_LIST", // getWatchRoomsResponse(rooms:MsGetRoomListExRsp);
    JOIN_WATCH_ROOM = "_JOIN_WATCH_ROOM",   // joinWatchRoomResponse(rsp:MVS.MsJoinWatchRoomRsp):void
    JOIN_WATCH_ROOM_NOTIFY = "_JOIN_WATCH_ROOM_NOTIFY", // joinWatchRoomNotify(user:MsRoomUserInfo):void

    LEAVE_WATCH_ROOM = "_LEAVE_WATCH_ROOM", // leaveWatchRoomResponse(status:number):void
    LEAVE_WATCH_ROOM_NOTIFY = "_LEAVE_WATCH_ROOM_NOTIFY", // leaveWatchRoomNotify(user:MVS.MsExitLiveRoomNotify):void

    SET_LIVE_OFFSET = "_SET_LIVE_OFFSET", // setLiveOffsetResponse(status:number):void
    LIVE_FRAME_UPDATE = "_LIVE_FRAME_UPDATE", // liveFrameUpdate(data:MsFrameData):void
    CHANGE_ROLE = "_CHANGE_ROLE", // changeRoleResponse(status:MVS.MsChangeRoleRsp):void

    CANCEL_TEAM_MATCH = "_CANCEL_TEAM_MATCH", // cancelTeamMatchResponse
    CANCEL_TEAM_MATCH_NOTIFY = "_CANCEL_TEAM_MATCH_NOTIFY", // cancelTeamMatchResponse
}

// matchvs 常见的网络异常码。
export const CODE = {
    "0": "成功",
    "-1": "失败",
    "-2": "未初始化",
    "-3": "正在初始化",
    "-4": "未登录",
    "-5": "正在登录",
    "-6": "已经登录，请勿重复登录",
    "-7": "正在创建或者进入房间",
    "-8": "已经在房间中",
    "-9": "正在重连",
    "-10": "正在登出",
    "-11": "正在登出",
    "-12": "正在加入观战房间",
    "-14": "正在观战离开房间",
    "-20": "1 <maxPlayer超出范围 ，maxPlayer须≤100",
    "-21": "Data 过长",
    "-23": "msgType 非法",
    "-24": "desttype 非法",
    "-25": "channel 非法，请检查是否正确填写为 “Matchvs”",
    "-26": "platform 非法，请检查是否正确填写为 “alpha” 或 “release”",
    "-27": "timeout 超出范围 0=< timeout <=600",
    "-30": "设置的 rType 值与当前模式冲突。",
};